from lxml import etree
import urllib.request
# tree = etree.parse("a.html")
# content = tree.xpath("//ul/li[@id='l1']/text()")
# print(content)

url = "https://www.baidu.com/"
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 Edg/94.0.992.38"
}
request=urllib.request.Request(url=url,headers=headers)
resonse=urllib.request.urlopen(request)
content=resonse.read().decode("utf-8")
tree=etree.HTML(content)
con=tree.xpath("//input[@id='su']/@value")[0]
print(con)
if __name__ == "__main__":
    print("Hello World")